window.phoenix&&(window.phoenix.buildInfo||(window.phoenix.buildInfo=[]),-1===window.phoenix.buildInfo.findIndex((i=>"Phoenix-upper-funnel"===i.MFE))&&window.phoenix.buildInfo.push({MFE:"Phoenix-upper-funnel",VERSION:"release-phoenix-upper-funnel-1.1.34939.1371721126-39f68b2d-4-g4c3fc7698",LASTCOMMITDATETIME:"2024-07-16T18:00:25-06:00"})) /*! * * ============= BUILD INFO ============= * MFE: Phoenix-upper-funnel * chunkName: component-clientlibs/productPromoDetails.v1/productPromoDetails * VERSION: release-phoenix-upper-funnel-1.1.34939.1371721126-39f68b2d-4-g4c3fc7698 * BRANCH: release/fix-upper-funnel0717 * COMMITHASH: 4c3fc7698bddb05cca402d984d9c7e93c1830225 * LASTCOMMITDATETIME: 2024-07-16T18:00:25-06:00 * ============= If you're reading this, why not come work with us? https://www.t-mobile.com/careers ============= */,function(){"use strict";!function(){const i="PDP_UPF_EXPERIENCE",e="PDP_CURRENT_SKU_CODE";window.Alpine.data("productPromoDetails",(()=>({component:{},displayShortDetails:!1,displayLongDetails:!1,activeSku:void 0,activeTitle:"",deviceThumbnail:void 0,activePromo:void 0,activeHref:void 0,promoHref:void 0,promotions:[],unsubscribeModal:void 0,init(){this.events(),this.component=this.$el},async displayPromoDetailsList(i){if(this.activeSku=i?.payload?.sku,this.promotions=i?.payload?.promos,this.activeTitle=i?.payload?.title,this.activeHref=i?.payload?.href,this.displayShortDetails=!0,this.deviceThumbnail=i?.payload?.image,!this.deviceThumbnail){const i=await window.phoenix.state.get(e),o=await window.phoenix.state.get("PDP_PRODUCT_FAMILIES"),t=o?Object.values(o)?.find((e=>e.sku===i))?.gallery:"";this.deviceThumbnail=t?Object.values(t)?.find((i=>i.url?.match("thumbnail")))?.url:""}this.unsubscribeModal=window.phoenix.bus.subscribe("MODAL","HIDE",this.reset.bind(this)),window.phoenix.bus.publish("PRODUCT_PROMOTIONS","DISPLAY_PROMOTIONS_MODAL")},displayLongDescription(i){this.activePromo=i,this.promoHref=this.activeHref&&this.activePromo.groupPromoId?this.activeHref+"?promoId="+this.activePromo.groupPromoId:"",this.toggleDescriptionType(!0)},toggleDescriptionType(i){this.displayLongDetails=i,this.displayShortDetails=!i,setTimeout((()=>{const i=document.querySelector(".phx-modal__dialog");i&&this.$focus?.focus(i)}))},async promoRedeemRedirect(){this.promoHref&&(await window.phoenix.persistedState.set("FLOW_TYPE","PFF"),await window.phoenix.persistedState.set(i,"UPGRADE:PFF"),setTimeout((()=>{this.promoHref&&(window.location.href=this.promoHref)}),100))},events(){window.phoenix.bus?.subscribe("PRODUCT_CARD","PROMOTION_DETAILS",this.displayPromoDetailsList.bind(this))},reset(){this.unsubscribeModal?.(),this.displayShortDetails=!1,this.displayLongDetails=!1,this.activeSku=void 0,this.activeTitle="",this.activePromo=void 0}})))}()}();